layui.use(['form', 'layer'], function () {
    window.onload = function () {
        if (window.parent.window !== window) {
            window.top.location = window.location.pathname + "/login";
        }
    };
});

/**
 *  执行键盘按键命令
 */
function keyDown(e) {
    var keycode = 0;
    // IE浏览器
    if(CheckBrowserIsIE()) {
        keycode = event.keyCode;
    }else{
        // 火狐浏览器
        keycode = e.which;
    }
    if (keycode === 13 ) {
        document.getElementById("login").submit();
    }
}

/**
 *  判断访问者的浏览器是否是IE
 * @return {boolean}
 */
function CheckBrowserIsIE(){
    var result = false;
    var browser = navigator.appName;
    if(browser === "Microsoft Internet Explorer"){
        result = true;
    }
    return result;
}